package com.example.nacosspringbootconfig.config;


import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("config")
public class ConfigController {

    @NacosValue(value = "${serverName:123}", autoRefreshed = true)
    private String  serverName;


    @RequestMapping(value = "get", method = RequestMethod.GET)
    public String get(){
        return serverName;
    }
}
